import {app, ipcMain, Notification} from 'electron'

class NoticeClass {
    constructor() {
        this.notification = null;
    }
    static send(title, body) {
        app.setAppUserModelId("com.gnerv.author");
        this.notification = new Notification({
            title: title,
            body: body
        });
        this.notification.show();
        return this.notification;
    }
}

ipcMain.on('send-message', (event, arg) => {
    NoticeClass.send("通知", arg)
})


export default NoticeClass;
